package com.accloud.cloudservice;

import com.accloud.service.ACClassDataMgr;
import com.accloud.service.ClassData;
import com.accloud.service.ClassTopic;
import com.accloud.service.Receiver;
import java.util.Map;

/* access modifiers changed from: package-private */
public class ACClassDataManager extends ACAbsDataManager implements ACClassDataMgr, Receiver<ClassData> {
    private ACClassDataMgr.ClassDataReceiver mClassReceiver;

    ACClassDataManager() {
        AC.sSockectManager.setClassDataReceiver(this);
    }

    @Override // com.accloud.service.ACClassDataMgr
    public void subscribe(String className, Map<String, Object> primaryKey, int opType, VoidCallback callback) {
        subscribe(ClassTopic.format(className, primaryKey, opType), callback);
    }

    @Override // com.accloud.service.ACClassDataMgr
    public void unSubscribe(String className, Map<String, Object> primaryKey, int opType, VoidCallback callback) {
        unSubscribe(ClassTopic.format(className, primaryKey, opType), callback);
    }

    @Override // com.accloud.service.ACClassDataMgr
    public void registerDataReceiver(ACClassDataMgr.ClassDataReceiver receiver) {
        this.mClassReceiver = receiver;
    }

    @Override // com.accloud.service.ACClassDataMgr
    public void unregisterDataReceiver(ACClassDataMgr.ClassDataReceiver receiver) {
        this.mClassReceiver = null;
    }

    public void onReceive(ClassData classData) {
        if (this.mClassReceiver != null) {
            this.mClassReceiver.onReceive(classData.getClassName(), classData.getOpType(), classData.getData());
        }
    }
}
